﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraEditors;
using System.Text.RegularExpressions;
namespace Sunboxsoft.ASMS.Client.UI.Common.Validations
{
    /// <summary>
    /// 不能输入特殊字符
    /// </summary>
    public class TextEditIsNotNullValidation : TextEditRegexValidation
    {
        /// <summary>
        /// 不能输入特殊字符
        /// </summary>
        /// <param name="textEdit"></param>
        public TextEditIsNotNullValidation(TextEdit textEdit, string strMess,bool isRequired)
            : base(textEdit, @"^[\w\d\u4E00-\u9FFF]*$", strMess, isRequired)
        {
        }
        public override bool ValueChanging(string newValue)
        {
            Regex regex = new Regex(@"^[\w\d\u4E00-\u9FFF]*$");
            if (regex.IsMatch(newValue))
            {
                return true;
            }
            return false;
        }
    }
}
